package com.zuoban.storage.api.impl;

import com.zuoban.storage.api.StorageApi;
import com.zuoban.storage.service.StorageService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

import java.io.InputStream;

/**
 * @BelongsProject: zuoban-boot
 * @BelongsPackage: com.zuoban.storage.api.impl
 * @Author: zxy
 * @CreateTime: 2022-10-10  10:59
 * @Description: ...
 */
@Component
@RequiredArgsConstructor
public class StorageApiImpl implements StorageApi {

    private final StorageService storageService;
    @Override
    public String getNewFileName(String fileName) {
        return storageService.getNewFileName(fileName);
    }

    @Override
    public String getNewPath(String... prefix) {
        return storageService.getNewPath(prefix);
    }

    @Override
    public String getNewPath(String fileName) {
        return storageService.getNewPath(fileName);
    }

    @Override
    public String upload(InputStream inputStream, String path) {
        return storageService.upload(inputStream, path);
    }
}
